package com.camel.network.controller;

import com.alibaba.fastjson.JSONObject;
import com.camel.core.model.Cdrinfo;
import com.camel.network.service.ZsCdrinfoService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.Map;

/**
 * 话单信息
 */
@RestController
@RequestMapping("/cdr")
public class CdrInfoController {

    @Autowired
    private ZsCdrinfoService cdrinfoService;

    @PostMapping("/pushCdrInfo")
    public String push(@RequestBody Map<String, Cdrinfo[]> params) {
        System.out.println("------------------------------");
        System.out.println(JSONObject.toJSONString(params));

        cdrinfoService.adds(params);
        return "success";
    }
}
